import App from './App'

import cnodeModel from '@/api/api.js';
Vue.prototype.$api = cnodeModel //挂载到Vue的原型上
import store from './store'
Vue.prototype.$store = store;
import queue from './common/queue'
Vue.prototype.$queue = queue;
import VueClipboard from 'vue-clipboard2'
Vue.use(VueClipboard)
// 利用window.sessionStorage.setItem将获取到的页面路径进行缓存
// 解决安卓注册config正常 则ios注册config 签名错误问题： 原因是ios 无论路由跳转多少次，复制出来的链接都是首次进入的页面的链接
window.sessionStorage.setItem('firstEntryUrl',window.location.href.split('#')[0])
import {
	VueJsonp
} from 'vue-jsonp'
Vue.use(VueJsonp)
Vue.config.ignoredElements = [...Vue.config.ignoredElements, 'wx-open-launch-weapp']

let uploadFileurl, domainName, baseUrl, appId, baseImgUrl, publicKey
// #ifdef H5-DEV
//开发环境
// baseUrl = 'http://192.168.0.168:6085/beeToken/equity'  //刘大哥
// baseUrl = 'http://192.168.0.167:6085/beeToken/equity'  //刘大哥
// baseUrl = 'http://192.168.0.186:6085/beeToken/equity'  //明宇
// baseUrl = 'https://pay.frp.yedaoyun.com/beeToken/equity' //内网穿透
// baseUrl = 'https://test.frp.yedaoyun.com/beeToken/equity'  //内网穿透
baseUrl = 'https://test.coco.milianmeng.net/beeToken/equity'  //测试
// baseUrl = 'http://192.168.0.111:6085/beeToken/equity' //明哥
// domainName = 'https://pay.frp.yedaoyun.com'
baseImgUrl = 'https://www.milianmeng.net/'
// appId = 'wxd1fecbb06631a19a'  // 刘大哥测试号
// appId = 'wxd5b3d18184138ef0'  // 模文的测试号  
// appId = 'wxad8262868cf1be3b'  // 运豪的测试号
appId = 'wxb7f6ee0e1f91499a' // 神椰公众号
// appId = 'wx1540c7692b0ffe13'  //卡优优
// appId = 'wxd5b3d18184138ef0'
publicKey =
	'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/yQrLWQTYZaQyTt/CVTmf+4di+Ge4tItryNoICVnTo2CIfxMCnwEgE0/Fz3RXvk05VxMSwxVI/NDUBpbbZT7RsMVIZmzkbyHftKheUvdQnLrTAHrrg4nAQK+bXnuv/am9RgGQnDueNLOqc/fVMm5CHirf5b6eemBldQyOUXFsrwIDAQAB' //加密公钥
// #endif
// #ifdef H5-TEST
//测试环境
baseUrl = 'https://test.coco.milianmeng.net/beeToken/equity'
domainName = 'https://test.coco.milianmeng.net'
appId = 'wxb7f6ee0e1f91499a'
baseImgUrl = 'https://www.milianmeng.net/'
publicKey =
	'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/yQrLWQTYZaQyTt/CVTmf+4di+Ge4tItryNoICVnTo2CIfxMCnwEgE0/Fz3RXvk05VxMSwxVI/NDUBpbbZT7RsMVIZmzkbyHftKheUvdQnLrTAHrrg4nAQK+bXnuv/am9RgGQnDueNLOqc/fVMm5CHirf5b6eemBldQyOUXFsrwIDAQAB' //加密公钥
// #endif
// #ifdef H5-PROD
// 生产环境
baseUrl = 'https://coco.milianmeng.net/beeToken/equity'
domainName = 'https://coco.milianmeng.net'
appId = 'wxb7f6ee0e1f91499a'
baseImgUrl = 'https://www.milianmeng.net/'
publicKey =
	'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC/yQrLWQTYZaQyTt/CVTmf+4di+Ge4tItryNoICVnTo2CIfxMCnwEgE0/Fz3RXvk05VxMSwxVI/NDUBpbbZT7RsMVIZmzkbyHftKheUvdQnLrTAHrrg4nAQK+bXnuv/am9RgGQnDueNLOqc/fVMm5CHirf5b6eemBldQyOUXFsrwIDAQAB' //加密公钥
// #endif
//#ifdef H5  

// app.$router.afterEach((to, from) => {
// 	const u = navigator.userAgent.toLowerCase()
// 	if (u.indexOf("like mac os x") < 0 || u.match(/MicroMessenger/i) != 'micromessenger') return
// 	if (to.path !== global.location.pathname) {
// 		location.assign(config.h5_addr + to.fullPath);
// 	}
// })

//#endif

Vue.prototype.baseUrl = baseUrl //图片上传地址
Vue.prototype.baseImgUrl = baseImgUrl //图片上传地址
Vue.prototype.uploadFileurl = baseUrl + '/common/v1/upload' //图片上传地址
Vue.prototype.domainName = domainName //分享地址
Vue.prototype.appId = appId //公众号appid
Vue.prototype.publicKey = publicKey //加密公钥


// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App
})
app.$mount()
// #endif

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app
	}
}
// #endif
